/**
 *
 * (c) Copyright Ascensio System SIA 2025
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.onlyoffice.integration.dto;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.onlyoffice.model.documenteditor.config.document.ReferenceData;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class RefreshConfig {
    @JsonProperty("document")
    private Document document;
    @JsonProperty("editorConfig")
    private EditorConfig editorConfig;
    @JsonProperty("token")
    private String token;

    @JsonProperty("error")
    private String error;

    @Getter
    @Setter
    @NoArgsConstructor
    public static class Document {
        @JsonProperty("title")
        private String title;
        @JsonProperty("key")
        private String key;
        @JsonProperty("url")
        private String url;
        @JsonProperty("referenceData")
        private ReferenceData referenceData;
        @JsonProperty("permissions")
        private Map<String, Object> permissions;
    }

    @Getter
    @Setter
    @NoArgsConstructor
    public static class EditorConfig {
        @JsonProperty("mode")
        private String mode = "edit";
        @JsonProperty("callbackUrl")
        private String callbackUrl;
    }
}
